package com.av.bcacc.javaapi.thread.priority;

import java.util.concurrent.FutureTask;

/**
 * @description 线程优先级
 * @author weiliang hu
 * @time 2021/7/17 16:26
 * @email:2072025612@qq.com
 */

public class PriorityTest {
    public static void main(String[] args) {
        MyCallable myCallable01=new MyCallable();
        FutureTask<String>futureTask=new FutureTask<>(myCallable01);
        Thread thread001=new Thread(futureTask,"线程1");
        thread001.setPriority(6);//范围1到10
        thread001.start();

        MyCallable myCallable02=new MyCallable();
        FutureTask<String>futureTask1=new FutureTask<>(myCallable02);
        Thread thread002=new Thread(futureTask1,"线程2");
        thread002.setPriority(7);//范围1到10
        thread002.start();

    }
}
